<template>
  <div class="wrapper">
    <swiper :options="swiperOption">
      <!-- slides -->
      <swiper-slide v-for="swiper in swiperList" :key="swiper.id">
        <img class="swiper-img" :src="swiper.imgUrl" />
      </swiper-slide>
      <!-- Optional controls -->
      <div class="swiper-pagination" slot="pagination"></div>
    </swiper>
  </div>
</template>

<script>
export default {
  name: "HomeSwiper",
  props: {
    swiperList: {
      type: Array
    }
  },
  data() {
    return {
      swiperOption: {
        pagination: ".swiper-pagination",
        loop: true,
        initialSlide: 1,
        autoplay: 3000,
      }
    };
  }
};
</script>

<style lang="less" scoped>
.wrapper {
  width: 100%;
  height: 0;
  padding-bottom: 30%;
  overflow: hidden;
}

.swiper-img {
  width: 100%;
}
</style>
